package cz.cuni.amis.episodic.lisp.netcreators;

import java.util.List;

import lombok.AllArgsConstructor;

/**
 * Executes sequence of trace modification strategies.
 * @author ik
 *
 */
@AllArgsConstructor
public class StrategySequence implements TraceModificationStrategy {

	
	TraceModificationStrategy[] strategies;
	
	@Override
	public <T> List<T[]> modifyTrace(List<T[]> traces, boolean countLast) {
		List<T[]> result = traces;
		for(TraceModificationStrategy strategy : strategies) {
			result = strategy.modifyTrace(result, countLast);
		}
		return result;
	}

	@Override
	public int getDepth() {
		return strategies[strategies.length-1].getDepth();
	}
	
	@Override
	public int getBatchSize() {
		for(TraceModificationStrategy strategy : strategies) {
			int length = strategy.getBatchSize();
			if(length > 0) return length;
		}
		return -1;
	}

}
